﻿<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html" ; charset="utf-8" />
    <title>缴费信息管理</title>
    <link href="../../../css/main.css" rel="stylesheet" type="text/css" />
    <link
      href="../../../bstable/css/bootstrap.min.css"
      rel="stylesheet"
      type="text/css"
    />
    <link
      href="../../../bstable/css/bootstrap-table.css"
      rel="stylesheet"
      type="text/css"
    />

    <style>
      .bootstrap-table {
        padding: 20px;
      }
    </style>
  </head>

  <body>
    <div class="tabe_div">
      <p class="p_line text_ient" style="border-bottom: 0">
        <a class="find_a">报考类型：</a>
        <select id="type" class="form_select" style="padding-left: 1%">
          <option value="">全部</option>
          <option value="education">学历提升</option>
          <option value="occupation">职业技能</option>
          <option value="title">职称评审</option>
          <option value="train">执业资格</option>
        </select>
        <a class="find_a">审核状态：</a>
        <select class="form_select" style="padding-left: 1%" id="status">
          <option value="">全部</option>
          <option value="0">已保存</option>
          <option value="1">已提交</option>
          <option value="2">待财务审核</option>
          <option value="3">财务驳回</option>
          <option value="4">待教务审核</option>
          <option value="5">教务驳回</option>
          <option value="6">教务确认</option>
          <option value="8">财务确认</option>
        </select>
        <a class="find_a">老师姓名：</a>
        <input
          id="teacherName"
          maxlength="18"
          type="text"
          class="form_input text_ient"
          placeholder="请输入老师姓名"
        />
        <a class="find_a">老师手机号：</a>
        <input
          id="teacherPhone"
          maxlength="18"
          type="text"
          class="form_input text_ient"
          placeholder="请输入老师手机号"
        />
        <input
          type="button"
          style="padding: 6px 35px"
          value="查询"
          class="but_find"
          id="search"
        />
      </p>
      <p class="text_ient">
        <a class="find_a">学生姓名：</a>
        <input
          id="studentName"
          maxlength="18"
          type="text"
          class="form_input text_ient"
          placeholder="请输入学生姓名"
        />
        <a class="find_a">学生身份证号：</a>
        <input
          id="idNo"
          maxlength="18"
          type="text"
          class="form_input text_ient"
          placeholder="请输入18位身份证号"
        />
        <!-- <a class="find_a">学生手机号：</a>
            <input id="mobile" maxlength="11" type="text" class="form_input text_ient" placeholder="请输入手机号" /> -->
        <a class="find_a">业务进度：</a>
        <select
          class="form_select"
          style="padding-left: 1%"
          id="businessProgress"
        >
          <option value="">全部</option>
          <option value="0">报考</option>
          <option value="1">退款</option>
          <option value="2">分期缴费</option>
        </select>

        <a class="find_a">报考项目：</a>
        <input
          type="text"
          id="applyProject"
          class="form_input text_ient"
          placeholder="输入报考项目"
        />
      </p>
      <table
        data-url="json/data_alae_list.json"
        id="table"
        class="table_style"
        style="margin: 0 auto"
      ></table>
    </div>
    <script src="../../../js/jquery.js"></script>
    <script src="../../../js/common.js"></script>
    <script src="../../../js/date/js/laydate.js"></script>
    <script src="../../../bstable/js/bootstrap.min.js"></script>
    <script src="../../../bstable/js/bootstrap-table.js"></script>
    <script src="../../../bstable/js/bootstrap-table-zh-CN.min.js"></script>
    <script src="../../../layer_v2.1/layer/layer.js"></script>
    <script type="text/javascript">
      localStorage.setItem("name", "财务管理/缴费信息管理");
      var pageNumber =
        location.search == "" ? 0 : location.search.split("=")[1];
      function changeFee(ids) {
        var arr = ids.split(",");
        $.ajax({
          url: baseUrl + "studentInfo/setStudentFeeFlag",
          method: "get",
          headers: {
            Authorization: JSON.parse(localStorage.getItem("userInfo")).token,
          },
          data: {
            studentId: arr[0],
            feeId: arr[1],
            feeFlag: arr[2],
          },
          success: function (data) {
            $("#table").bootstrapTable("refresh");
            alert("操作成功");
          },
          error() {
            alert("操作失败");
          },
        });
      }
      $(function () {
        $("#search").on("click", function () {
          $("#table").bootstrapTable("refresh");
        });
        var perm = JSON.parse(localStorage.getItem("userInfo")).perm;
        $("#table").bootstrapTable({
          method: "get",
          striped: true,
          singleSelect: false,
          url: baseUrl + "studentInfo/getStudentList",
          dataType: "json",
          sidePagination: "server",
          pagination: true, //分页
          pageSize: 10,
          pageNumber: Number(pageNumber) + 1,
          // rowStyle:rowStyle,
          search: false, //显示搜索框
          contentType: "application/x-www-form-urlencoded",
          ajaxOptions: {
            headers: {
              Authorization: JSON.parse(localStorage.getItem("userInfo")).token,
            },
          },
          queryParams: function (params) {
            params.trainType = $("#type").val().trim();
            params.idNo = $("#idNo").val().trim();
            params.teacherMobile = $("#teacherPhone").val().trim();
            params.teacherName = $("#teacherName").val();
            params.commitFlag = $("#status").val().trim();
            params.businessProgress = $("#businessProgress").val().trim();
            params.applyProject = $("#applyProject").val().trim();
            params.name = $("#studentName").val().trim();
            params.userType = "caiwu";
            params.offset = params.offset / params.limit;
            pageNumber = params.offset;
            delete params.order;
            return params;
          },
          responseHandler: function (res) {
            console.log(res);
            var list = res.data.result.records;
            var maps = {
              education: "学历提升",
              occupation: "职业技能",
              title: "职称评审",
              train: "执业资格",
            };
            list.forEach(function (item, i) {
              item.trainTypeName = maps[item.trainType];
              !item && (list[i] = {});
              if (item.feeFlag == 0) {
                item.feeFlagName = "否";
              } else {
                item.feeFlagName = "是";
              }
              if (item.businessProgress === 0) {
                item.businessProgressName = "报考";
              } else if (item.businessProgress === 1) {
                item.businessProgressName = "退款";
              } else if (item.businessProgress === 2) {
                item.businessProgressName = "分期缴费";
              }
            });

            return {
              rows: list,
              total: res.data.total,
            };
          },
          columns: [
            {
              field: "no",
              title: "序号",
              sortable: true,
              align: "center",
              width: 100,
              formatter: function (value, row, index) {
                var pageSize =
                  $("#table").bootstrapTable("getOptions").pageSize;
                var pageNumber =
                  $("#table").bootstrapTable("getOptions").pageNumber;
                return pageSize * (pageNumber - 1) + index + 1;
              },
            },
            {
              title: "学生姓名",
              field: "name",
              align: "center",
              valign: "middle",
            },
            {
              title: "身份证号",
              field: "idNo",
              align: "center",
            },
            {
              title: "报考项目",
              field: "applyProject",
              align: "center",
            },
            {
              title: "报考专业",
              field: "studentMajor",
              align: "center",
            },
            {
              title: "报考类型",
              field: "trainTypeName",
              align: "center",
            },
            //  {
            //     title: '招生老师手机号',
            //     field: 'teacherMobile',
            //     align: 'center'
            // }
            {
              title: "老师姓名",
              field: "teacherName",
              align: "center",
            },
            {
              title: "实缴费用",
              field: "amount",
              align: "center",
            },
            {
              title: "缴费状态",
              field: "feeFlagName",
              align: "center",
            },
            {
              title: "报考进度",
              field: "submissionFlag",
              align: "center",
              formatter: function (value, row, index) {
                const map = { 0: "未报考", 1: "已报考" };
                return map[row.submissionFlag];
              },
            },
            {
              title: "证书",
              field: "receiveFlag",
              align: "center",
              formatter: function (value, row, index) {
                const map = { 0: "未领取", 1: "已领取" };
                return map[row.receiveFlag];
              },
            },
            {
              title: "审核状态",
              field: "commitStr",
              align: "center",
            },
            {
              title: "业务进度",
              field: "businessProgressName",
              align: "center",
            },
            {
              title: "操作",
              field: "oper",
              align: "center",
              formatter: function (value, row) {
                var e =
                  '<a href="#" onclick="look(\'' +
                  row.id +
                  "', '" +
                  row.idNo +
                  "', '" +
                  row.colorFlag +
                  "', '" +
                  row.trainType +
                  "', '" +
                  row.studyId +
                  "', '" +
                  row.businessProgress +
                  "')\">查看</a> ";

                var b =
                  '<a href="#" onclick="tuikuanlook(\'' +
                  row.id +
                  "', '" +
                  row.idNo +
                  "', '" +
                  row.colorFlag +
                  "', '" +
                  row.trainType +
                  "', '" +
                  row.studyId +
                  "', '" +
                  row.businessProgress +
                  "', '" +
                  row.commitFlag +
                  "')\">查看</a> ";

                var d =
                  '<a href="#" onclick="check(\'' +
                  row.id +
                  "', '" +
                  row.idNo +
                  "', '" +
                  row.colorFlag +
                  "', '" +
                  row.trainType +
                  "', '" +
                  row.studyId +
                  "')\">审核</a> ";

                var c =
                  '<a href="#" onclick="refund(\'' +
                  row.id +
                  "', '" +
                  row.idNo +
                  "', '" +
                  row.colorFlag +
                  "', '" +
                  row.trainType +
                  "', '" +
                  row.studyId +
                  "')\">审核</a> ";

                var q =
                  '<a href="#" onclick="fenqi(\'' +
                  row.id +
                  "', '" +
                  row.idNo +
                  "', '" +
                  row.colorFlag +
                  "', '" +
                  row.trainType +
                  "', '" +
                  row.studyId +
                  "')\">审核</a> ";

                var a =
                  '<a href="#" style="margin-left:8px" onclick="refundUpload(\'' +
                  row.id +
                  "', '" +
                  row.idNo +
                  "', '" +
                  row.trainType +
                  "', '" +
                  row.feeId +
                  "', '" +
                  row.studyId +
                  "')\">凭证上传</a> ";

                var i =
                  '<a href="#" onclick="lookPrint(\'' +
                  row.id +
                  "', '" +
                  row.idNo +
                  "', '" +
                  row.colorFlag +
                  "', '" +
                  row.trainType +
                  "', '" +
                  row.studyId +
                  "', '" +
                  row.teacherName +
                  "', '" +
                  row.commitFlag +
                  "')\">查看</a> ";

                var optionStr = row.businessProgress == 1 ? b : e;

                if (row.businessProgress == 1 && row.commitFlag == 10) {
                  optionStr += a;
                }

                if (row.businessProgress == 0 && row.commitFlag == 2) {
                  optionStr += d;
                }

                if (row.businessProgress == 1 && row.commitFlag == 2) {
                  optionStr += c;
                }

                if (row.businessProgress == 2 && row.commitFlag == 2) {
                  optionStr += q;
                }

                if (row.businessProgress == 0 || row.businessProgress == 2) {
                  if (row.commitFlag == 6 || row.commitFlag == 10) {
                    optionStr = i;
                  }
                }

                return optionStr;

                // return e + d + c + q + a;

                // var optionStr = e;

                // if (row.businessProgress === 0) {
                //     optionStr += d;
                // } else if (row.businessProgress === 1){
                //     optionStr += c;
                //     if (row.commitFlag === 10) {
                //         optionStr += a
                //     }
                // } else if (row.businessProgress === 2) {
                //     optionStr += q;
                // }
                // return optionStr;
              },
            },
          ],
        });
      });

      function look(id, idNo, flag, trainType, studyId) {
        // window.location.href = '../hotel/all-look.html?type=look&from=jiaofei&id=' + id + '&idNo=' + idNo + '&flag=' + flag + '&trainType=' + trainType + '&studyId=' + studyId
        window.location.href =
          "../student/check.html?type=look&action=caiwu&id=" +
          id +
          "&idNo=" +
          idNo +
          "&flag=" +
          flag +
          "&trainType=" +
          trainType +
          "&studyId=" +
          studyId +
          "&pageNumber=" +
          pageNumber;
      }

      function lookPrint(id, idNo, flag, trainType, studyId, commitFlag) {
        // window.location.href = '../hotel/all-look.html?type=look&from=jiaofei&id=' + id + '&idNo=' + idNo + '&flag=' + flag + '&trainType=' + trainType + '&studyId=' + studyId
        window.location.href =
          "../student/edit.html?type=look&from=student&lookName=cw&action=print&id=" +
          id +
          "&idNo=" +
          idNo +
          "&flag=" +
          flag +
          "&trainType=" +
          trainType +
          "&studyId=" +
          studyId +
          "&teacherName=" +
          teacherName +
          "&pageNumber=" +
          pageNumber +
          "&commitFlag=" +
          commitFlag;
      }

      function tuikuanlook(id, idNo, flag, trainType, studyId, commitFlag) {
        // window.location.href = '../hotel/all-look.html?type=look&from=jiaofei&id=' + id + '&idNo=' + idNo + '&flag=' + flag + '&trainType=' + trainType + '&studyId=' + studyId
        window.location.href =
          "../student/edit.html?type=look&lookName=cw&from=refund&id=" +
          id +
          "&idNo=" +
          idNo +
          "&flag=" +
          flag +
          "&trainType=" +
          trainType +
          "&studyId=" +
          studyId +
          "&pageNumber=" +
          pageNumber +
          "&commitFlag=10";
      }

      function refundUpload(id, idNo, trainType, feeId, studyId) {
        window.location.href =
          "./uploadPing.html?id=" +
          id +
          "&idNo=" +
          idNo +
          "&trainType=" +
          trainType +
          "&feeId=" +
          feeId +
          "&studyId=" +
          studyId;
      }

      function check(id, idNo, flag, trainType, studyId) {
        window.location.href =
          "../student/check.html?type=look&from=caiwu&id=" +
          id +
          "&idNo=" +
          idNo +
          "&flag=" +
          flag +
          "&trainType=" +
          trainType +
          "&studyId=" +
          studyId;

        // window.location.href = '../hotel/student_look.html?type=edit&from=student&id=' + id + '&idNo=' + idNo + '&flag=' + flag + '&trainType=' + trainType + '&studyId=' + studyId
      }

      function fenqi(id, idNo, flag, trainType, studyId) {
        window.location.href =
          "../student/check.html?type=look&from=caiwu&action=fenqi&id=" +
          id +
          "&idNo=" +
          idNo +
          "&flag=" +
          flag +
          "&trainType=" +
          trainType +
          "&studyId=" +
          studyId;
        // window.location.href = '../hotel/student-fenqi.html?type=fenqi&from=jiaofei&id=' + id + '&idNo=' + idNo + '&flag=' + flag + '&trainType=' + trainType + '&studyId=' + studyId
      }

      function refund(id, idNo, flag, trainType, studyId) {
        window.location.href =
          "../student/refund-check.html?type=look&from=caiwu&action=tuikuan&id=" +
          id +
          "&idNo=" +
          idNo +
          "&flag=" +
          flag +
          "&trainType=" +
          trainType +
          "&studyId=" +
          studyId;
        // window.location.href = '../hotel/student-refund.html?type=tuikuan&from=jiaofei&id=' + id + '&idNo=' + idNo + '&flag=' + flag + '&trainType=' + trainType + '&studyId=' + studyId
      }

      // function rowStyle(item, index) {
      //     style = item.colorFlag == 1 ? {css:{'color':'#ed5565'}} : {}
      //     return style;
      // }
    </script>
  </body>
</html>
